package com.ruoyi.system.service.impl;

import java.util.Calendar;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TmcPropertyNoticeMapper;
import com.ruoyi.system.domain.TmcPropertyNotice;
import com.ruoyi.system.service.ITmcPropertyNoticeService;

/**
 * 物业公告Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-04-08
 */
@Service
public class TmcPropertyNoticeServiceImpl implements ITmcPropertyNoticeService 
{
    @Autowired
    private TmcPropertyNoticeMapper tmcPropertyNoticeMapper;

    /**
     * 查询物业公告
     * 
     * @param id 物业公告ID
     * @return 物业公告
     */
    @Override
    public TmcPropertyNotice selectTmcPropertyNoticeById(Long id)
    {
        return tmcPropertyNoticeMapper.selectTmcPropertyNoticeById(id);
    }

    /**
     * 查询物业公告列表
     * 
     * @param tmcPropertyNotice 物业公告
     * @return 物业公告
     */
    @Override
    public List<TmcPropertyNotice> selectTmcPropertyNoticeList(TmcPropertyNotice tmcPropertyNotice)
    {
        return tmcPropertyNoticeMapper.selectTmcPropertyNoticeList(tmcPropertyNotice);
    }

    /**
     * 新增物业公告
     * 
     * @param tmcPropertyNotice 物业公告
     * @return 结果
     */
    @Override
    public int insertTmcPropertyNotice(TmcPropertyNotice tmcPropertyNotice)
    {
        //获取当前时间
        Calendar calendar = Calendar.getInstance();
        tmcPropertyNotice.setCreatetime(calendar.getTime());
        return tmcPropertyNoticeMapper.insertTmcPropertyNotice(tmcPropertyNotice);
    }

    /**
     * 修改物业公告
     * 
     * @param tmcPropertyNotice 物业公告
     * @return 结果
     */
    @Override
    public int updateTmcPropertyNotice(TmcPropertyNotice tmcPropertyNotice)
    {
        return tmcPropertyNoticeMapper.updateTmcPropertyNotice(tmcPropertyNotice);
    }

    /**
     * 批量删除物业公告
     * 
     * @param ids 需要删除的物业公告ID
     * @return 结果
     */
    @Override
    public int deleteTmcPropertyNoticeByIds(Long[] ids)
    {
        return tmcPropertyNoticeMapper.deleteTmcPropertyNoticeByIds(ids);
    }

    /**
     * 删除物业公告信息
     * 
     * @param id 物业公告ID
     * @return 结果
     */
    @Override
    public int deleteTmcPropertyNoticeById(Long id)
    {
        return tmcPropertyNoticeMapper.deleteTmcPropertyNoticeById(id);
    }

    @Override
    public List<TmcPropertyNotice> queryPropertyNotice() {
        return tmcPropertyNoticeMapper.queryPropertyNotice();
    }
}
